import request from '@/utils/request'

// 查询班次列表
export function listWork (query) {
  return request({
    url: '/prod-api/system/set/list',
    method: 'get',
    params: query
  })
}



// 查询班次详细
export function getWork (workId) {
  return request({
    url: '/prod-api/system/set/' + workId,
    method: 'get'
  })
}

// 新增班次
export function addWork (data) {
  return request({
    url: '/prod-api/system/set',
    method: 'post',
    data: data
  })
}

// 修改班次
export function updateWork (data) {
  return request({
    url: '/prod-api/system/set/update',
    method: 'put',
    data: data
  })
}

// 删除班次
export function delWork (workId) {
  return request({
    url: '/prod-api/system/set/' + workId,
    method: 'delete'
  })
}

// 排版日历列表
export function getPlanList (query) {
  return request({
    url: '/prod-api/system/plan/list',
    method: 'get',
    params: query
  })
}

export function listByStoreId (query) {
  return request({
    url: '/prod-api/system/plan/listByStoreId',
    method: 'get',
    params: query
  })
}


// 排版角色列表 
export function getPlanRole () {
  return request({
    url: '/prod-api/system/post/list',
    method: 'get'
  })
}

// 单天的新增和修改
export function toSetOneDayPlan (data) {
  return request({
    url: '/prod-api/system/plan/add',
    method: 'put',
    data
  })
}

// 一个月的新增和修改
export function toSetMonthPlan (data) {
  return request({
    url: '/prod-api/system/plan/edit',
    method: 'put',
    data: data
  })
}

export function delWorkP (workId) {
  return request({
    url: '/prod-api/system/plan/' + workId,
    method: 'delete'
  })
}